package com.metis.document.parse.dialog.api;

import java.util.List;
import java.util.concurrent.CompletableFuture;

import javax.servlet.http.HttpServletResponse;

import com.metis.document.parse.dialog.constant.DesensitizationRegexEnum;
import com.metis.document.parse.dialog.models.dto.ParseResultDTO;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "metis-document-parse", url = "${domain.metis.parse-api.url:}", contextId = "metis-document-parse",path = "/parse")
@Validated
public interface ParseControllerApi {
    @PostMapping(value = "/parsePDF", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,headers = "accept=application/json",produces = "application/json")
    ResponseEntity<ParseResultDTO> parsePDF(
            @ApiParam(value = "待解析PDF文件") @RequestPart("file") MultipartFile file,
            @ApiParam(value = "是否包含页面大小信息") @RequestParam(required = false, defaultValue = "true") Boolean includePageSizeInfo,
            @ApiParam(value = "是否包含行文本信息") @RequestParam(required = false, defaultValue = "true") Boolean includeText,
            @ApiParam(value = "是否包含段落信息") @RequestParam(required = false, defaultValue = "true") Boolean includeParagraph,
            @ApiParam(value = "是否包含表格信息") @RequestParam(required = false, defaultValue = "true") Boolean includeTable,
            @ApiParam(value = "是否包含图片信息") @RequestParam(required = false, defaultValue = "true") Boolean includeImages,
            @ApiParam(value = "是否包含概要信息") @RequestParam(required = false, defaultValue = "true") Boolean includeSummaryInfo,
            @ApiParam(value = "脱敏策略") @RequestParam(required = false) List<DesensitizationRegexEnum> desensitizationStrategy);
}
